<?php
	$tplBanner = new XTemplate('view/banner.htm');
	
	$tplBanner->assign('baseUrl', $baseUrl);
	$sql = 'SELECT * FROM tablbanner WHERE 1=1 ';
	$banners = $db->fetchAll($sql);
	foreach ( $banners as $banner ) {
		if( $banner['banner_right']==1 ){
			$tplBanner->insert_loop('BANNER.BANNERRIGHT', array('BANNERRIGHT'=>$banner));
		}
		if ( $banner['banner_left']==1 ) {
			$tplBanner->insert_loop('BANNER.BANNERLEFT', array('BANNERLEFT'=>$banner));
		}
	}
	$tplBanner->parse('BANNER');
	$banner = $tplBanner->text('BANNER');